package com.tengju.user.domain.model.sign;

import java.util.Arrays;
import lombok.Getter;

@Getter
public enum StarBlacklistValidStatusEnum {
    VALID(1, "有效"),
    INVALID(2, "无效");

    private int code;
    private String desc;

    StarBlacklistValidStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public static StarBlacklistValidStatusEnum getByCode(int code) {
        return Arrays.stream(StarBlacklistValidStatusEnum.values())
                .filter(k -> k.getCode() == code)
                .findFirst().orElse(null);
    }
}
